import request from "@/utils/request";

// 获取学生成绩
export const getStudentGradesService = (studentId) => {
    return request.get(`/grades/student?studentId=${studentId}`);
};

// 获取学生平均成绩
export const getStudentAverageGradeService = (studentId) => {
    return request.get(`/grades/average?studentId=${studentId}`);
};

// 获取学生总成绩
export const getStudentTotalGradeService = (studentId) => {
    return request.get(`/grades/total?studentId=${studentId}`);
};

// 获取所有学生成绩
export const getStudentGradesAllService = () => {
    return request.get(`/grades/all`);
}

//添加学生成绩
export const gradeAddService = (params) => {
    return request.post('/grades/add', params);
}

//修改学生成绩
export const updateGradeService = (params) => {
    return request.post('/grades/update', params);
}

//删除学生成绩
export const deleteGradeService = (params) => {
    return request.delete('/grades/delete?studentId='+params.studentId+'&courseId='+params.courseId);
}